package repositories;

import java.util.Collection;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import domain.Vacancy;

public interface VacancyRepository extends JpaRepository<Vacancy, Integer> {
	@Query("select v from Vacancy v where v.project.id = ?1")
	Collection<Vacancy> findByProject(int projectId);

	@Query("select v from Vacancy v where v.project.id = ?1 and v.userGroup.id = ?2")
	Vacancy findByProjectAndGroupId(int projectId, int userGroupId);
}
